package com.action.log;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.business.log.LogFavorBus;
import com.config.SystemGlobals;

public class UpdateFavorLog extends HttpServlet {

	private static final long serialVersionUID = 1L;
	
		public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		
			String contentType = SystemGlobals.getValue("contentType");
			PrintWriter out = response.getWriter();
			response.setContentType(contentType);
			String action = request.getParameter("action");
			String favorNo = request.getParameter("no");
			if ("del".equals(action)) {
				LogFavorBus lfb = new LogFavorBus();
				lfb.del(favorNo);
				out
						.println("<script>alert(\"删除收藏日志成功\");window.location=\"user/favorlist.jsp\";</script>");
			}
			if ("edit".equals(action)) {
				RequestDispatcher rd = request
						.getRequestDispatcher("user/editfavor.jsp?no="+favorNo);
				rd.forward(request, response);
			}
	}

}
